package com.bole.webflux.reactor;

import reactor.core.publisher.Flux;

/**
 * @author: 叶子
 * @date: 2022/03/31 22:28
 **/
public class ReactorDemo3 {
    /**
     * 输入：hello guys i am bole welcome to normal school jdk quick for prizev
     * 输出：abcdefghijklmnopqrstuvwxyz
     */
    public static void main(String[] args) {
        String src = "hello guys i am bole welcome to normal school jdk quick for prizev";
        Flux.fromArray(src.split(" "))//以空格分割成单词组成的数组
                .flatMap(i->Flux.fromArray(i.split("")))//把每个单词以空字符串分隔成一个个字母组成的新数组
                .distinct()
                .sort()
                .subscribe(System.out::print);
    }
}